﻿define(['ajax'], function (ajax) {
    "use strict";

    var exports = {}, ViewModel;

    ViewModel = function () {
        var self = this;
        self.oldpassword = ko.observable();
        self.newpassword = ko.observable();
        self.confirmpassword = ko.observable();

        self.changePassword = function () {
            var form = {
                oldPassword: self.oldpassword(),
                newPassword: self.newpassword(),
                confirmPassword: self.confirmpassword(),
            };            

            ajax.put('Auth', form).done(function() {                
               
            });
        };
    };

    exports.exec = function () {
        var viewModel = new ViewModel();
        ko.applyBindings(viewModel, document.getElementById('body'));
    };

    return exports;
});